requirejs.config({
    baseUrl : './',
    paths : {
        "jquery" : [ "/common/vendor/jquery-2.1.4/jquery-2.1.4.min" ],
        "base" : [ "/common/scripts/base" ],
        "ajax" : [ "/common/scripts/ajax" ],
        "underscore": ["/common/vendor/underscore-1.8.3/underscore.min"],
        "chart": ["/common/charts/chart"],
        "local": "/common/scripts/local"  
    },
    shim: {        
        "chart": {
            deps: ["jquery"],
            exports: 'chart'
        }
    }
});
require(["jquery","base", "ajax","underscore","chart","local"], function($, base, ajax,_,chart,local) {
    "use strict";
    var DATAK = [
            ["20170113", "3345.75", "3319.91", "3309.37", "3370.51"],
            ["20170120", "3314.15", "3354.89", "3264.21", "3358.41"],
            ["20170203", "3390.93", "3364.49", "3362.57", "3392.48"],
            ["20170210", "3368.11", "3413.49", "3347.43", "3422.33"],
            ["20170217", "3416.92", "3421.44", "3416.87", "3457.56"],
            ["20170224", "3421.64", "3473.85", "3421.64", "3492.96"],
            ["20170303", "3471.13", "3427.86", "3412.83", "3472.84"],
            ["20170310", "3427.25", "3427.89", "3414.68", "3457.04"],
            ["20170317", "3425.67", "3445.81", "3412.69", "3492.13"],
            ["20170324", "3449.05", "3489.6", "3429.83", "3499.32"],
            ["20170331", "3488.76", "3456.05", "3422.37", "3505.98"],
            ["20170407", "3476.42", "3517.46", "3475.15", "3526.82"],
            ["20170414", "3519.46", "3486.5", "3466.14", "3523.1"],
            ["20170421", "3475.74", "3466.79", "3418.51", "3489.08"],
            ["20170428", "3458.23", "3439.75", "3399.54", "3466.57"],
            ["20170505", "3427.92", "3382.55", "3366.56", "3436.31"],
            ["20170512", "3369.11", "3385.38", "3312.89", "3387.27"],
            ["20170519", "3391.59", "3403.85", "3373.55", "3433.97"],
            ["20170526", "3400.59", "3480.43", "3383.89", "3498.31"],
            ["20170602", "3495.07", "3486.51", "3470.2", "3515.08"],
            ["20170609", "3480.17", "3576.17", "3460.45", "3590.89"],
            ["20170616", "3570.22", "3518.76", "3508.95", "3603.69"],
            ["20170623", "3520.06", "3622.88", "3520.06", "3635.53"],
            ["20170630", "3627.02", "3666.8", "3627.02", "3676.53"],
            ["20170707", "3667.23", "3655.93", "3610.46", "3667.6"],
            ["20170714", "3647.94", "3703.09", "3640.59", "3703.09"],
            ["20170721", "3700.62", "3728.6", "3621.37", "3751.69"],
            ["20170728", "3724.38", "3721.89", "3672.5", "3755.19"],
            ["20170804", "3722.43", "3707.58", "3707", "3784.35"],
            ["20170811", "3701.22", "3647.35", "3645.09", "3746.86"],
            ["20170818", "3651.38", "3724.67", "3651.38", "3733.49"],
            ["20170825", "3731.84", "3795.75", "3728.62", "3795.97"],
            ["20170901", "3805.66", "3830.54", "3800.89", "3866.94"],
            ["20170908", "3828.54", "3825.99", "3813.55", "3865.29"],
            ["20170915", "3828.34", "3831.3", "3817.51", "3854.49"],
            ["20170922", "3832.96", "3837.73", "3816.82", "3862.36"],
            ["20170929", "3829.22", "3836.5", "3808.38", "3852.22"],
            ["20171001", "3910.11", "3921", "3855.47", "3927.17"],
            ["20171020", "3926.28", "3926.85", "3900.48", "3947.42"],
            ["20171027", "3930.89", "4021.97", "3920.66", "4024.46"],
            ["20171103", "4022.16", "3992.7", "3960.27", "4033.34"],
            ["20171110", "3989.18", "4111.91", "3975.41", "4116.71"],
            ["20171113", "4115.55", "4120.85", "4055.72", "4137.65"],
            ["20171130", "4093.73", "4104.2", "4057.49", "4260.64"],
            ["20171201", "4088.93", "3998.14", "3984.38", "4088.93"],
            ["20171231", "3989.05", "4003.38", "3955.44", "4045.93"],
            ["20171220", "4006.88", "3980.86", "3974.93", "4070.15"],
            ["20171222", "3983.3", "4054.6", "3967.93", "4080.78"],
            ["20171231", "4057.42", "4030.85", "3980.24", "4086.93"]
        ],
        dataKList = {
            min: 3264.31,
            max: 4292.64,
            list: DATAK
        };
    var realDate = true,
        defalutSize = 45,
        lineChart =null,
        trueIndexEnd = base.getUrlParameter('trueIndexEnd') || 0,
        trueIndexStart = base.getUrlParameter('trueIndexStart') || 0,
        gbDataIndex = 0,
        timer = null,
        account = '',
        page = 1,
        pageSize = 50,
        str = '',
        unit = '',
        isRefresh = false,
        dataType = base.getUrlParameter('dataType') || '06',
        zIndex = base.getUrlParameter('zIndex') || '--',//周期
        stockCode = base.getUrlParameter('stockCode') || '',//股票代码
        marketCode = base.getUrlParameter('marketCode') || '',//市场代码
        stockName = base.getUrlParameter('stockName') || '',//股票名称
        payoff = base.getUrlParameter('payoff') ? decodeURIComponent(base.getUrlParameter('payoff')) : '--',//盈利金额
        kLineStartDate = base.getUrlParameter('startDate') || '--',//k线图开始时间
        kLineEndDate = base.getUrlParameter('endDate') || '--',//k线图结束时间
        startDate = base.getUrlParameter('kLineStartDate') || '',//开始时间
        endDate = base.getUrlParameter('kLineEndDate') || '',//结束时间
        trueStartDate = base.getUrlParameter('trueStartDate') || '',//结束时间,
        trueEndDate = base.getUrlParameter('trueEndDate') || '',//结束时间
        trueCenterDate = base.getUrlParameter('trueCenter') || '',//中间时间
        currency = base.getUrlParameter('currency') || '401156', //401156 人民币 401344  港元 401840 美元
        source = base.getUrlParameter('source') || '150001'; //系统源 150001 普通 150002 信用  150003 限售股 150000 全账户
    var point = {
        init:function(){
            var self = this;
            $('.key-stock').html(decodeURIComponent(stockName));
            $('.poit-date').html(kLineStartDate.slice(2).replace(/\//g,'.')+" - " + kLineEndDate.slice(2).replace(/\//g,'.'));
            $('.stock-index').html('周期 '+zIndex);
            local.read({
                P_SOURCE: "", //系统源 150001 普通 150     002 信用  150003 限售股 150000 全账户
                P_CURRENCY: "", //401156 人民币 401344  港元 401840 美元
                P_ACCOUNT:""
            }, function(_obj) {
                currency = _obj.P_CURRENCY;
                switch (currency){
                    case '港币':{
                        str = '401344';
                        break;
                    }
                    case '美元':{
                        str = '401840';
                        break;
                    }
                    case '元':{
                        str = '401156';
                        break;
                    }
                    default:{
                        str = '401156';
                        break;
                    }
                }
                //source = _obj.P_SOURCE;
                account = _obj.P_ACCOUNT;
                self.getData(str);
                self.pageEvent();
            });
            if(base.isAndroid()){
                $('body').addClass('android');
            };
        },
        /**
         * [getData 获取个股买卖分析数据]
         * @return {[type]} [description]
         */
        getData:function(curren){
            var self = this,
                url = "/reqxml?action=27401&path=/account/hold_analysis/stock_buy_sell_point",
                params = {
                    clientNo:account,
                    token:"($Token)",
                    source:source,//来源
                    currency:curren,//币种
                    stockCode:stockCode,
                    marketCode:marketCode,
                    startDate:kLineStartDate.replace(/\//g,''),
                    endDate:kLineEndDate.replace(/\//g,''),
                    page:page,
                    pageSize:pageSize
                };
            ajax.run(url,params, function(data) {
                if(data && data.BINDATA){
                    var obj = JSON.parse(data.BINDATA),
                        code = obj.code,
                        msg = obj.msg;
                    if (code === "0") {
                        if(page != 1){
                            $('.more').html('刷新成功');
                        }
                        self.parseData(obj.data);
                    } else {
                        msg = msg && msg != '' ? msg : "接口返回错误"
                        alert(msg);
                    }
                }else{
                    alert("接口返回错误");
                }
            }, function(obj) {
                $('.onput').hide();
                var msg = obj.ERRORMESSAGE && obj.ERRORMESSAGE != '' ? obj.ERRORMESSAGE : "网络错误";
                alert(msg);
            });
        },
        /**
         * [parseData 解析接口返回数据]
         * @param  {[type]} 接口返回数据 [description]
         * @return {[type]}      [description]
         */
        parseData:function(data){
            var self = this;
            //k线图 数据
            if(page == 1){
                if(realDate){
                    getKData(stockCode,startDate.replace(/\//g,'-'),endDate.replace(/\//g,'-'),function(json){
                        self.drawCanvas(json.list,json.max,json.min,data.buySellList);
                    });
                }else{
                    self.drawCanvas(dataKList.list,dataKList.max,dataKList.min,data.buySellList);
                }
                //列表数据
                if(data && data.baseInfo){
                    var baseData = data.baseInfo,
                        totalBuyNum = baseData.totalBuyNum && baseData.totalBuyNum != '' ? baseData.totalBuyNum : '--',//周期内总买入次数
                        totalSellNum = baseData.totalSellNum && baseData.totalSellNum != '' ? baseData.totalSellNum : '--',//周期内总卖出次数
                        totalNum = '--';//周期内总卖出次数
                    if(totalBuyNum != '--' && totalSellNum != '--'){
                        totalNum = parseInt(totalBuyNum) + parseInt(totalSellNum);
                    }
                    var _show = payoff.indexOf('--'),
                        show = _show < 0 ? payoff.replace((/\+|\-/gi),'')+currency : payoff;
                    $('.poit-detail').html("<span>【交易明细】</span>期间共交易"+totalNum+"次，买入"+totalBuyNum+"次，卖出"+totalSellNum+"次，"+ show);
                    if(data.baseInfo.zlist && data.baseInfo.zlist.length != 0){
                        if(data.baseInfo.zlist.length >= pageSize){
                            $('.more').show();
                        }else{
                            $('.more').hide();
                        }
                        self.renderHtml(data.baseInfo.zlist);
                    }
                }
            }else{
                isRefresh = false;
                if(data.baseInfo.zlist.length < pageSize){
                    $('.more').hide();
                }else{
                    $('.more').html('上拉加载更多').show();
                }
                self.renderHtml(data.baseInfo.zlist);
            }
        },
        /**
         * [renderHtml 渲染页面]
         * @param  {[type]} 交易列表 [description]
         * @return {[type]}       [description]
         */
        renderHtml:function(zlist){
            var html = '';
            _.each(zlist,function(item){
                var type_html = '',
                    type = item.type;
                if(item.typeFlag == '1'){
                    if(type.length > 4){
                        type_html = '<div class="buseniess-type type-buy small">'+type+'</div>'
                    }else{
                        type_html = '<div class="buseniess-type type-buy">'+type+'</div>'
                    }
                }else if(item.typeFlag == '0'){
                    if(type.length > 4){
                       type_html = '<div class="buseniess-type type-seil small">'+type+'</div>'
                    }else{
                       type_html = '<div class="buseniess-type type-seil">'+type+'</div>'
                    }
                }else{
                    if(type.length > 4){
                       type_html = '<div class="buseniess-type type-other small">'+type+'</div>'
                    }else{
                       type_html = '<div class="buseniess-type type-other">'+type+'</div>'
                    }
                }
                html = html + 
                    '<li class="clear">'+
                        '<div class="list-item">'+
                            '<div class="list-time">'+item.showDate.replace(/\//g,'.')+'</div>'+
                            '<div class="list-roll"><span class="line"></span></div>'+type_html+
                        '</div>'+
                        '<div class="list-item">'+
                            '<div class="list-price">'+item.price+currency+'</div>'+
                            '<div class="list-stock">'+item.num+'</div>'+
                        '</div>'
                    '</li>';
            });
            if(page == 1){
                $('.poit-list').html(html);
            }else{
                $('.poit-list').append(html);
            }
        },
        drawDialogReact:function(chart) {
            var self = this,
                ctx = chart.ctx,
                width = chart.width,
                height = chart.height-16,
                zhlist = [],
                arr = document.querySelector("#canvas canvas"),
                attr = arr.getAttribute("data-points"),
                unit = width / defalutSize;
            attr = JSON.parse(attr);
            var _attrString = JSON.stringify(attr),
                _startTime = new Date(trueStartDate.replace(/(\d{4})(\d{2})(\d{2})/g, '$1/$2/$3')).getTime(),
                _endTime = new Date(trueEndDate.replace(/(\d{4})(\d{2})(\d{2})/g, '$1/$2/$3')).getTime(),
                _centerTime = new Date(trueCenterDate.replace(/(\d{4})(\d{2})(\d{2})/g, '$1/$2/$3')).getTime(),
                _dateMin = new Date(attr[0].date.replace(/(\d{4})(\d{2})(\d{2})/g, '$1/$2/$3')).getTime(),
                _dateMax = new Date(attr[attr.length-1].date.replace(/(\d{4})(\d{2})(\d{2})/g, '$1/$2/$3')).getTime();
            if(_startTime < _dateMin){
                zhlist[0] = 0;
            }
            if(_endTime > _dateMax){
                zhlist[1] = width;
            }
            _.each(attr,function(item,i){
                var _itemDate = new Date(item.date.replace(/(\d{4})(\d{2})(\d{2})/g, '$1/$2/$3')).getTime();
                if(_startTime == _itemDate){
                    zhlist[0] = item.x
                }
                if(_endTime == _itemDate){
                    zhlist[1] = item.x;
                }
                if(_centerTime == _itemDate){
                    zhlist[3] = item.x - unit/2;
                }
            });
            if(zhlist && zhlist[1] && zhlist.length != 0){
                ctx.beginPath();
                if(zhlist[3]){
                    ctx.font="13px PingFangSC-Medium";
                    ctx.fillStyle="#FF8400";
                    ctx.fillText(zIndex,zhlist[3],height-5);
                }
                ctx.lineWidth = "0.5";
                ctx.strokeStyle = "#FF8400";
                ctx.fillStyle = "rgba(251,164,87,0.20)";
                self.drawReact(ctx, zhlist[0], 0.5, (zhlist[1] - zhlist[0]), height,width);
                if((zhlist[1] - zhlist[0]) == 0){
                    ctx.rect(zhlist[0], 0.5, 1, height);
                }else{
                    ctx.rect(zhlist[0], 0.5, (zhlist[1] - zhlist[0]), height);
                }
                ctx.fill();
                ctx.restore();
            }
        },
        //虚线矩形
        drawReact:function(ctx, x, y, w, h, cw) {
            var self = this;
            self.drawDashedLine(ctx, x, y, (x + w), y, '#FF8400', '0.5', '2');
            if((w+x) < cw){
                self.drawDashedLine(ctx, (x + w), y, (x + w), (y + h), '#FF8400', '0.5', '2');
            }
            self.drawDashedLine(ctx, (x + w), (y + h), x, (y + h), '#FF8400', '0.5', '2');
            if(x != 0){
               self.drawDashedLine(ctx, x, (y + h), x, y, '#FF8400', '0.5', '2');
            }
        },
        drawDashedLine:function(ctx, sx, sy, tx, ty, color, lineWidth, dashLen) {
            var self = this,
                len = self.cacuDis(sx, sy, tx, ty),
                lineWidth = lineWidth || 1, //虚线宽度
                dashLen = dashLen || 2, //虚线默认间隔
                num = ~~(len / dashLen); //虚线数量
            ctx.beginPath();
            for (var i = 0; i < num; i++) {
                var x = sx + (tx - sx) / num * i,
                    y = sy + (ty - sy) / num * i;
                ctx[i & 1 ? "lineTo" : "moveTo"](x, y);
            }
            ctx.closePath();
            ctx.lineWidth = lineWidth; //配置线条宽度
            ctx.strokeStyle = color; //配置线条颜色
            ctx.stroke(); //闭合线
        },
        cacuDis:function(sx, sy, tx, ty) {
            return Math.sqrt(Math.pow(tx - sx, 2) + Math.pow(ty - sy, 2));
        },
        /**
         * [drawCanvas 画k线图]
         * @param  {[type]} list [k线图数据]
         * @param  {[type]} max [k线图最大值]
         * @param  {[type]} min [k线图最小值]
         * @param  {[type]} pointList [买卖点数据]
         * @param  {[type]} cycleObj [周期数据]
         * @return {[type]}      [description]
         */
        drawCanvas:function(list,max,min,pointList){
            var self = this,
                start = list[0][0],
                len = list.length,
                end = list[len - 1][0];
            unit = (max - min) * 0.05;
            //gbDataIndex trueIndexEnd trueIndexStart
            if(trueIndexStart >= defalutSize){
                gbDataIndex = trueIndexEnd - defalutSize + 1;
            }else{
                gbDataIndex = 0;
            }
            lineChart = new chart({
                dom: "#canvas",
                grid: {
                    yLineStyle: {
                        lineWidth: 1,
                        strokeStyle: 'rgba(224,224,224,.5)'
                    },
                    yGridLine: [false, true, true, false]
                },
                scale: 1.2,
                series: [{
                        type: 'K',
                        min: min,
                        max: max,
                        data:list,
                        columnWidth: '80%',
                        global:pointList,
                        maskList:[
                            { min: endDate.replace(/\//g,''), max:end , maxWidth:true}
                        ]
                    },
                ],
                dataIndex:gbDataIndex,
                defaultDataSize: defalutSize,
                drag: true,
                events: {
                    touchstart: function(x,chart){},
                    canvasChangeStart:function(that){},
                    touchmove: function(x, chart){},
                    touchend: function(that) {},
                    canvasChange: function(x, chart) {
                        self.drawDialogReact(chart);
                        gbDataIndex = chart.dataIndex;
                    },
                    canvasChangeEnd: function(chart) {
                        gbDataIndex = chart.dataIndex;
                    }
                },
                flexible: {
                    left: 0,
                    top: 10,
                    right: 0,
                    bottom: 16
                },
                xAxis: {
                    data: [{ label: start.replace(/(\d{4})(\d{2})(\d{2})/g, '$1/$2/$3'), textStyle: { fillStyle: '#979797' } }, { label: endDate.replace(/(\d{4})(\d{2})(\d{2})/g, '$1/$2/$3'), textStyle: { fillStyle: 'transparent' } }],
                    margin: [12,5],
                    alignment: "justify",
                    lineStyle:{
                        lineWidth:'1', 
                        strokeStyle:'rgba(224,224,224,.5)'
                    },
                    textStyle: {
                        font: '12px PingFangSC-Regular',
                    }
                },
                yAxis: {
                    show: false,
                    avgNum: 1,
                    margin:5,
                    labelAlign: 'inside',
                    basisPoint: false,
                    textStyle: {
                        font: '10px PingFangSC-Regular',
                        fillStyle: 'transparent'
                    },
                    formatter: function(value) {
                        return value.toFixed(2)
                    }
                }
            });
            //K线右下角显示滑动查看
            if(len>defalutSize){
                $("#canvas .more-txt").show();
            }
            $('.y-top').html(max);
            $('.y-bottom').html(min);
            if (timer) {
                clearTimeout(timer);
            }
            timer = setTimeout(function() {
                self.drawDialogReact(lineChart);
            },5);
            $('.onput').hide();
            $('body').on("touchend", function(){
                var top = $(document).scrollTop();
                base.log('top=='+top);
                if(top >= 330){
                    if($('#canvas img').length == 0){
                        self.saveImgData(lineChart.canvas);
                    }else{
                        self.changeImg(lineChart.canvas);
                    }
                    
                }else{
                    $('#canvas canvas').show();
                    $('#canvas img').hide();
                }
            });
        },
        saveImgData: function(canvas) {
            var self = this;
            canvas.style.display = "none";
            var dataURL = canvas.toDataURL();
            var parentNode = canvas.parentNode;
            if($('#canvas').find('img').length == 0){
                var imgNode = document.createElement('img');
                    imgNode.id = canvas.id+"-img";
                    imgNode.width = parseFloat(canvas.style.width);
                    imgNode.height = parseFloat(canvas.style.height);
                    imgNode.src = dataURL;
                    parentNode.appendChild(imgNode); 
            }
            base.log("saveImgData===="+dataURL);        
        },
        changeImg:function(canvas){
            var width = parseFloat(canvas.style.width);
            var height = parseFloat(canvas.style.height);
           
            var dataURL = canvas.toDataURL();
            var parentNode = canvas.parentNode;
            var imgNode = document.createElement('img');
            imgNode.id = canvas.id+"-img";
            imgNode.width = width;
            imgNode.height = height;
            imgNode.src = dataURL;
            parentNode.replaceChild(imgNode,canvas.parentNode.querySelector("img")); 
            canvas.style.display = "none";
            imgNode.style.display = "block"; 
            base.log("changeImg===="+dataURL);
        },
        /**
         * [drawPoits 画k线图的买卖点]
         * @param  {[type]} pointList [买卖点数组 包括 买卖点的index ]
         * @return {[type]}           [description]
         */
        drawPoits:function(){
            var self = this,
                cycleObj = {};
            var arr = document.querySelector("#canvas canvas");
            var attr = arr.getAttribute("data-points");
            attr = JSON.parse(attr);
            _.each(attr,function(item,i){
                if(new Date(kLineStartDate).getTime() == new Date(item.date.replace(/(\d{4})(\d{2})(\d{2})/g, '$1/$2/$3')).getTime()){
                    cycleObj.start = item.date
                }
                if(new Date(kLineEndDate).getTime() == new Date(item.date.replace(/(\d{4})(\d{2})(\d{2})/g, '$1/$2/$3')).getTime()){
                    cycleObj.end = item.date
                }
            });
            return cycleObj;
        },
        pageEvent: function() {
            $(window).scroll(function() {
                var top = $(window).scrollTop(),
                    bodyHeight = window.innerHeight,
                    totalHeight = $(".poit-content").height();
                if ((top + bodyHeight) >= totalHeight && !isRefresh) {
                    isRefresh = true;
                    var time = setTimeout(function() {
                        page++;
                        $('.more').html('正在刷新');
                        point.getData(str);
                        clearTimeout(time);
                        time = null;
                    }, 300);
                }
            });
        }
    }
    point.init();
    //1A0001
    function getKData(code,start, end, fn) {
        var range = 500;
        if(dataType == '01'){
            range = 100;
        }else if(dataType == '03'){
            range = 200;
        }else if(dataType == '06'){
            range = 500;
        }
        base.href("http://action:80014/?stockcode=" + code + "&&daterange="+range+"&&jsfuncname=KdateFn");
        window.KdateFn = function(data) {
            var tm = typeof(data) == "object" ? data : JSON.parse(data),
                _list = tm.list,
                _list_self = [];
            base.log("getkDate=="+_list);
            var _start = new Date(start).getTime();
            var _end = new Date(end).getTime();
            var count = 0;

            for(var i = 0; i < _list.length; i++){
                 var _time = new Date(_list[i][0]).getTime();
                 if( _time >= _start ){    
                    var preClosePrice = i != 0 ? _list[i - 1][4] : _list[i][4]; //上个交易日收盘价  
                    var currentClosePrice = _list[i][4]; //选中交易日收盘价  
                    var range = ((currentClosePrice - preClosePrice) / preClosePrice * 100).toFixed(2); //涨跌幅度 (当前收盘价 - 上一交易日收盘价) / 上一交易日收盘价  
                    count++;
                    if(count <= defalutSize){
                        _list_self.push([_list[i][0].replace(/(\d{4})[-|\/](\d{2})[-|\/](\d{2})/gi, "$1$2$3"), _list[i][3], _list[i][4], _list[i][2], _list[i][1], range]); //开盘 收盘 最低 最高 涨幅                         
                        continue;
                    }
                    if(_time<=_end){
                        _list_self.push([_list[i][0].replace(/(\d{4})[-|\/](\d{2})[-|\/](\d{2})/gi, "$1$2$3"), _list[i][3], _list[i][4], _list[i][2], _list[i][1], range]); //开盘 收盘 最低 最高 涨幅
                    }else{
                        break;
                    }
                 }
            }
            var list_max = [],list_min = [];
            for(var i=0;i<_list_self.length;i++){
                list_max.push(Number(_list_self[i][4]));
                list_min.push(Number(_list_self[i][3]));
            }
            var max = Math.max.apply(null, list_max);
            var min = Math.min.apply(null, list_min);
            base.log('==list=='+_list_self+'==max=='+max+'==min=='+min);
            fn && fn({
                list: _list_self,
                max: max,
                min: min,
            });
        };
    }
});

